<script setup lang="ts">
definePageMeta({
    title: "登录页面",
    layout: false,
})

const mockLogin = () => {
    ElMessage.success("登录成功");
    useUserStore().setToken("admin999");
    navigateTo("/");
}

// 页面挂载完成后仅客户端才会执行
onMounted(() => {
    const route = useRoute()
    if(route?.query?.result){
        ElMessage.error(route.query.message as string)
    }
})
</script>

<template>
    <div>
        <div class="text-2xl">
            登录页面
        </div>
        <div>
            <u-button @click="mockLogin">模拟登录</u-button>
        </div>
    </div>
</template>

<style scoped>
</style>